#ifndef _UIBASEIMPL_H_
#define _UIBASEIMPL_H_

#include "stdafx.h"

class CMainViewImpl :	    public IPlugin,
							public IPluginRun,
							public IMsgPlugin,
							public IUIEvent,
							public CUnknownImp
{
public:
	CMainViewImpl(void);
	virtual ~CMainViewImpl(void);
public:

	BEGIN_STDCOM_MAP
		STDCOM_INTERFACE_ENTRY_UNKNOWN_(IMsgPlugin)
		STDCOM_INTERFACE_ENTRY(IPlugin)
		STDCOM_INTERFACE_ENTRY(IPluginRun)
		STDCOM_INTERFACE_ENTRY(IMsgPlugin)
		STDCOM_INTERFACE_ENTRY(IUIEvent)
	END_STDCOM_MAP

	//IPlugin
	std_method(Init)(int Argc, basic_tchar* Argv[], IBase* pRot, IBase* pBase);
	std_method(Uninit)();
	
	//IPluginRun
	std_method(Start)(_pinstance hInstance, UINT uType);
	std_method(Stop)(UINT uExitCode);

	//IMsgPlugin
	std_method(Send)(REFCLSID sn, REFCLSID tn, UINT msg, IBase* pInMsg, IBase* pOutMsg);
	std_method(Recv)(REFCLSID sn, REFCLSID tn, UINT msg, IBase* pInMsg, IBase* pOutMsg);
	std_method(Push)(REFCLSID sn, REFCLSID tn, UINT msg, IBase* pMsg);
	std_method(Poll)(REFCLSID sn, REFCLSID tn, UINT msg, IBase* pMsg);
	std_method_(ULONG, GetRoute)();
	std_method_(ULONG, GetSub)();
	std_method(Set)(ULONG ad);

	//IUiEvent
	std_method(OnUiEvent)(const NotifyEvent* event);


private:
	ComRotMessagePtr			m_pRot;
	_lComPtr<IUIBase>			m_pIUiBase;
	_lComPtr<IUIWindow>			m_pIUiWindow;
	_lComPtr<IUIMessageLoop>	m_pIUiMessageLoop;
	_lComPtr<ILogs>				m_pILogs;

};

#endif 

